﻿ CREATE  proc [dbo].[danhmucDonGia_NVL_TP_Sua]  
@matp varchar(20),  
@tentp nvarchar(255),  
@dvt nvarchar(50),  
--@sln float,  
@dgnvl float,  
--@tylepb float,  
--@chisopb float,  
--@ttn float,  
--@dongia float,  
@mmyy varchar(10)  
  
as  
if exists(select * from DM_DG_NVL_TP  Where matp <>@matp and tentp=@tentp  )  
begin  
select ErrCode=0  
end  
else  
begin  
update DM_DG_NVL_TP set tentp=@tentp, dvt=@dvt,dgnvl=@dgnvl,mmyy=@mmyy  
  
  Where matp = @matp     
   
select ErrCode=1  
end